package com.yoshino.observer.improve;

/**
 * @author yoshino
 **/
public class Client {
    public static void main(String[] args) {
        WeatherData weatherData = new WeatherData();

        // 创建观察者
        CurrentConditions currentConditions = new CurrentConditions();


        // 注册
        weatherData.registerObserver(currentConditions);

        weatherData.setData(10,100,30.3f);
        System.out.println("==========");

        // 新观察者
        BaiduSite baiduSite = new BaiduSite();
        weatherData.registerObserver(baiduSite);

        weatherData.setData(1,10,30f);

        System.out.println("===============");

        weatherData.removeObserver(currentConditions);
        weatherData.setData(10,100,30.3f);

    }
}
